<?php
// +----------------------------------------------------------------------
// | 幕小铺
// +----------------------------------------------------------------------
// | 版权所有 2016~2020 幕小铺科技（大连）有限公司
// +----------------------------------------------------------------------
// | 2020/03/14
// +----------------------------------------------------------------------
namespace app\user_center\behavior\user\sms_sending_before;

/**
 * 发送短信校验
 * @package app\user_center\behavior\user\sms_sending_before
 * @author shiqiang
 */
class checkSendTimes{
    /**
     * 执行行为 run方法是Behavior唯一的接口
     * @access public
     * @return void
     */
    public function run($params){
		$snedCount = config('mobile_send_top_today');
		$mobile = $params['mobile'];
		// 今日短信发送次数
		$sendTodayCount = model('UcMemberMobileSendcode', 'model\user') -> getDataTodayTimes($mobile);
		if($snedCount <= $sendTodayCount['data']){
        //判断144 直接发送成功
        if($mobile > 14400000000 && $mobile <= 14499999999){
            return array_out(200, 'success');
        }
			  return array_out(-1001, '今日短信发送次数已达上限');
		}
    }
}
